<span>修改密码</span>
<form id="user-update-pwd-form">
    <table>
        <tr>
            <td>原密码：</td>
            <td><input type="password" name="password"></td>
        </tr>
        <tr>
            <td>新密码：</td>
            <td><input type="password" name="new_password"></td>
        </tr>
        <tr>
            <td>重新输入密码：</td>
            <td><input type="password" name="re_password"></td>
        </tr>
        <tr>
            <td><input type="button" value="确定" onclick="updateUserPwd()"></td>
        </tr>
    </table>
</form>
<script type="text/javascript">

    var updateUserPasswordXhr;
    function updateUserPwd() {
        if (updateUserPasswordXhr) updateUserPasswordXhr.abort();
        updateUserPasswordXhr = $.ajax({
            url: "/api/user/update/pwd",
            type: "post",
            data: $("#user-update-pwd-form").serialize(),
            dataType: "json",
            cache: false,
            beforeSend: function() {
            },
            complete: function() {
            },
            success: function (result) {
                alert(result.msg);
                if (result.code == 200) {

                }
            },error: function (result) {
                alert("网络连接出错！");
            }
        });
    }
</script>